<!DOCTYPE html>
<script src="../../../../../resources/testharness.js"></script>
<script src="../../../../../resources/testharnessreport.js"></script>
<script src="../../../../../fast/spatial-navigation/resources/snav-testharness.js"></script>

<body>
<button id="button" autofocus>button</button>

<script>
  let button = document.getElementById("button");

  promise_test(async () => {
    await snav.rAF();
    await snav.rAF();
    assert_equals(document.activeElement,
                  button,
                  "'button' should start focused.");
    assert_equals(window.internals.interestedElement,
                  button,
                  "'button' should start interested.");

    document.activeElement.blur()
    await snav.rAF();

    assert_equals(document.activeElement,
                  document.body,
                  "'body' should be focused.");
    assert_equals(window.internals.interestedElement,
                  button,
                  "'button' should still be interested.");

  }, 'Spat Nav does not pass interest to the body.');
</script>
</body>
